
Vue.component('com-title', {
  template: `<div class="title">
                <h3>{{title}}</h3>
                <span v-if="morePath" @click="toPath(morePath)">查看更多</span>
            </div>`,
  props: {
    title: {
      type: String,
      default: '文字标题'
    },
    morePath:{
      type: String | Boolean,
      default: () => {
        return false
      }
    }
  },
  methods: {
    toPath(path, name = '_self') {
      // 如果新打开页面第二个参数name请传入 _blank
      window.open(path, name)
    }
  }
});